package com.encyclopedia.controller;

import com.encyclopedia.entity.LoginUser;
import com.encyclopedia.result.JsonRequest;
import com.encyclopedia.service.LoginUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author MaLiang
 * @version 1.0
 * @date 2024-04-26 19:31
 */
@RestController
@RequestMapping("/admin/login")
public class LoginUserController {


    @Autowired
    private LoginUserService loginUserService;


    @PostMapping
    public JsonRequest login(@RequestBody LoginUser loginUser) {
        return loginUserService.login(loginUser);
    }


    @PostMapping("/register")
    public JsonRequest register(@RequestBody LoginUser loginUser) {
        return loginUserService.register(loginUser);
    }

}
